

/// Create risk set data structure for the analysis


// Set working directory
cd "/Users/.../ReplicationArchive/"

insheet using "full_data.csv", c
tsset country_id year


//////// Create risk set structure (drop after dv_abolition = 1)

bys country_id (year) : gen it_adoption_cont = sum(it_adoption)
bys country_id (year) : gen it_adoption_sum = sum(it_adoption_cont)
// browse country year it_adoption it_adoption_cont it_adoption_sum
bys country_id (year) : drop if it_adoption_sum > 1

drop it_adoption_cont it_adoption_sum

outsheet using "riskset_data.csv", c replace







